/***********************************************************************/
/*                                                                     */
/*  FILE        :resetprg.h                                            */
/*  DATE        :Tue, Jun 03, 2014                                     */
/*  DESCRIPTION :include some headder files.                           */
/*  CPU GROUP   :2D                                                    */
/*                                                                     */
/*  This file is generated by Renesas Project Generator (Ver.4.19).    */
/*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
/***********************************************************************/
/************************************************************************
*
* Device     : R8C Family
*
* File Name  : resetprg.h
*
* Abstract   : Include some headder files.
*
* History    : 1.20  (2009-01-26)
*              1.21  (2010-01-13)
*
* NOTE       : THIS IS A TYPICAL EXAMPLE.
*
* Copyright (C) 2009 (2010) Renesas Electronics Corporation.
* and Renesas Solutions Corp.
*
************************************************************************/

#ifndef __CSTARTDEF__
#define __CSTARTDEF__

#include "cstartdef.h"
#pragma STACKSIZE       __STACKSIZE__           //user stack
#pragma ISTACKSIZE      __ISTACKSIZE__          //interrupt stack

#pragma CREG    _flg_   flg
#pragma CREG    _isp_   isp
#pragma CREG    _sp_    sp
#pragma CREG    _sb_    sb
#pragma CREG    _fb_    fb
#pragma CREG    _intbh_ intbh
#pragma CREG    _intbl_ intbl
_UINT _flg_;
_UINT _sb_;
_UINT _fb_;
_UINT *_sp_;
_UINT *_isp_;
_UINT *_intbl_;
_UINT *_intbh_;

#define  DEF_BANKSELECT		_asm("	.glb	__BankSelect\n"\
				"__BankSelect	.equ	0BH")
#define  DEF_SBREGISTER         _asm("	.glb	__SB__\n"\
				"__SB__	.equ	0400H")

#if __STACKSIZE__ != 0
#define __F_value__	0x0080U
#else
#define __F_value__	0x0000U
#endif


#if __HEAPSIZE__ != 0
//extern        _UBYTE _far * _mbase;
extern  _UBYTE _far * _mnext;
extern  _UDWORD _msize;
//////////////////////////////////////////
// It's size of heap
// When you want to change size of heap,
// please change this line.
// When you change this line,
// you must modify the value using hex character.
                                                                                
extern _UBYTE heap_area[__HEAPSIZE__];


_inline void heap_init(void);
_inline void heap_init(void)
{
/*      _mbase = &heap_area[0];*/
        _mnext = &heap_area[0];
        _msize = (_UDWORD)__HEAPSIZE__;
}
                                                                                
#endif
#pragma sectaddress	vector,ROMDATA
#endif
